home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 23 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  40 lines

  1. Newsgroups: comp.sys.m68k
  2. Path: netcom.com!ludis
  3. From: ludis@netcom.com (Ludis Langens)
  4. Subject: Re: BSR vs. JSR
  5. Message-ID: <ludisDKozAI.7pL@netcom.com>
  6. Organization: It's here somewhere
  7. References: <30EBF0B3.6749@bmdl2.bbn.hp.com>
  8. Date: Fri, 5 Jan 1996 05:01:30 GMT
  9. Sender: ludis@netcom10.netcom.com
  10.  
  11. In article <30EBF0B3.6749@bmdl2.bbn.hp.com> Ernst Geesmann <praktwg@bmdl2.bbn.hp.com> writes:
  12. >My software uses BSR and JSR instructions.  Everything's fine if
  13. >the stack is placed into SRAM.  But if I place the stack into DRAM
  14. >strange things happen:
  15. >On BSR the return address is pushed to the stack - OK
  16. >Several BSR follow, each time return address is pushed and
  17. >can be pulled - OK
  18. >A JSR is used, return address pushed - OK
  19. >With the first BSR after this JSR only the lower 16 bit of the
  20. >return address is pushed to the stack, but the stack pointer is
  21. >moved for 4 furthter bytes.
  22.  
  23. Three ideas:
  24.   1) You have a memory trashing bug.
  25.   2) Your BSRs/JSRs aren't written correctly to deal with 32 bit addresses:
  26.       You might have exceeded the range of a BSR.W (and your assembler
  27.       didn't catch it.)  Partial address decoding might make the code
  28.       run, but the upper word of the PC is wrong.
  29.       You used JSR <ABS.W> where JSR <ABS.L> is needed.
  30.   3) You have a memory timing bug (maybe a refresh problem) that just
  31.      happens to show up where you found it (i.e. it has nothing to do
  32.      with BSR vs JSR.)
  33.  
  34. I'd say that #1 is the most likely problem...
  35.  
  36. -- 
  37.                   unsigned long Obfuscate(unsigned long i) {unsigned long t;
  38. Ludis Langens        return i ? (t = Obfuscate(i >> 1), (t << 1) + (i & 1) + 
  39. ludis@netcom.com                 (t + 858993459 >> 2 & 572662306) * 3) : 0;}
  40.